package o;

import android.text.TextUtils;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appmarket.service.webview.agent.NegotiateResponse;

public class enc implements IServerCallBack {
    public a ˎ;

    public interface a {
        void ˊ(boolean z, int i);
    }

    public void ˏ() {
        if (UserSession.getInstance().isLoginSuccessful()) {
            cfw.ˎ(new emx(), this);
        }
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        if (responseBean instanceof NegotiateResponse) {
            Object ˊ = ((NegotiateResponse) responseBean).ˊ();
            if (responseBean.getResponseCode() == 0 && responseBean.getRtnCode_() == 0 && !TextUtils.isEmpty(ˊ)) {
                HcridSession.ˋ().ˎ(ˊ);
            }
        }
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
        boolean z = false;
        if (responseBean != null) {
            int responseCode = responseBean.getResponseCode();
            if (responseCode == 0 && responseBean.getRtnCode_() == 0 && !TextUtils.isEmpty(((NegotiateResponse) responseBean).ˊ())) {
                z = true;
            }
            if (this.ˎ != null) {
                this.ˎ.ˊ(z, responseCode);
            }
        }
    }
}
